package com.unknowpupil.design.bridge;

/**
 * @Description: <p>
 *  电脑 类型
 * </p>
 * @Author: <a> w10g </a>
 * @CreateDate: Create in 2020/4/27 18:21
 * @Classname: Computer
 * @Version: 1.0
 */
public abstract class Computer {
    protected Brand brand;

    public Computer(Brand brand) {
        this.brand = brand;
    }

    public void sale(){
        brand.sale();
    }
}

class Desktop extends Computer{

    public Desktop(Brand brand) {
        super(brand);
    }

    @Override
    public void sale() {
        super.sale();
        System.out.println("销售台式机");
    }


}

class Laptop extends Computer{

    public Laptop(Brand brand) {
        super(brand);
    }

    @Override
    public void sale() {
        super.sale();
        System.out.println("销售笔记本机");
    }

}
// 随时增加类型。独立的
